package com.zhijian.warehouse.manage.dao;

import com.zhijian.warehouse.manage.entity.export.StoreInExport;
import com.zhijian.warehouse.manage.entity.po.StoreRecord;
import com.zhijian.warehouse.manage.entity.vo.request.StoreRecordSearchVo;
import com.zhijian.warehouse.manage.entity.vo.response.StoreRecordVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface StoreRecordMapper {
    int deleteByPrimaryKey(Long id);

    int insert(StoreRecord record);

    int insertSelective(StoreRecord record);

    StoreRecord selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(StoreRecord record);

    int updateByPrimaryKey(StoreRecord record);

    /**
     * 查询总数
     *
     * @param storeRecordSearchVo
     * @return
     */
    int count(StoreRecordSearchVo storeRecordSearchVo);

    /**
     * 查询列表
     *
     * @param storeRecordSearchVo
     * @return
     */
    List<StoreRecordVo> selectList(StoreRecordSearchVo storeRecordSearchVo);

    /**
     * 查询单个
     *
     * @param storeRecordSearchVo
     * @return
     */
    StoreRecordVo selectOne(StoreRecordSearchVo storeRecordSearchVo);

    /**
     * 根据ID查询vo
     *
     * @param id
     * @return
     */
    StoreRecordVo selectVoById(Long id);

    /**
     * 批量删除
     *
     * @param idList
     * @return
     */
    void deleteByIdList(@Param("idList") List<Long> idList);

    /**
     * 动态删除
     *
     * @param storeRecordSearchVo
     * @return
     */
    void deleteByCondition(StoreRecordSearchVo storeRecordSearchVo);

    /**
     * 批量新增
     *
     * @param entities
     * @return
     */
    int insertBatch(@Param("entities") List<StoreRecord> entities);

    /**
     * 根据WarehouseId查询列表
     *
     * @param warehouseId
     * @return
     */
    List<StoreRecordVo> selectListByWarehouseId(Long warehouseId);

    /**
     * 根据CreateUserId查询列表
     *
     * @param createUserId
     * @return
     */
    List<StoreRecordVo> selectListByCreateUserId(Long createUserId);

    /**
     * 根据UpdateUserId查询列表
     *
     * @param updateUserId
     * @return
     */
    List<StoreRecordVo> selectListByUpdateUserId(Long updateUserId);

    /**
     * 查询出某天最新数据的number
     *
     * @param day
     * @return
     */
    String selectMaxNumberByDay(String day);

    /**
     * 查询出某天最新数据的number
     *
     * @return
     */
    List<StoreInExport> selectStoreInExportList(StoreRecordSearchVo param);
}